import { PORT1 } from "../config/servicePort";
import Http from "@/api/index";

export const createLouPan = (params: any) => {
  return Http.post(PORT1 + "/system/loupan/add", params);
};

export const getLouPanList = (params: any) => {
  return Http.post(PORT1 + "/system/loupan/list", params);
};

export const getInfo = (id: any) => {
  return Http.get(PORT1 + "/system/loupan/info", { id });
};

export const editLouPan = (params: any) => {
  return Http.put(PORT1 + "/system/loupan/edit", params);
};

export const deleteLou = (params: any) => {
  return Http.post(PORT1 + "/system/loupan/delete", params);
};

// 获取驻守人员
const baseUrl = PORT1 + "/system/loupan";
export const getGarrison = (params: any) => {
  return Http.get(baseUrl + "/get_garrison", params);
};

// 解除经纪人
export const releaseBroker = (params: any) => {
  return Http.post(baseUrl + "/release_broker", params);
};

// 添加驻守人员
export const addBroker = (params: any) => {
  return Http.post(baseUrl + "/add_broker", params);
};

// 获取可以驻守的人员
export const getBrokersCanBindThisLouPan = (params: any) => {
  return Http.get(baseUrl + "/can_garrison", params);
};

export const getCheckPhone = (params: any) => {
  return Http.get(baseUrl + "/phone_400", params);
};

export const addPhoneAudio = (lou_id: number, params: any) => {
  return Http.post(baseUrl + "/phone_add?lou_id=" + lou_id, params);
};

export const updateAwaitAudio = (dn: string) => {
  return Http.post(baseUrl + "/phone_await?dn=" + dn);
};
